<template>
  <ElTabs v-model="query[prop]" @tab-change="onChange">
    <ElTabPane
      v-for="(item, index) in props.tabs"
      :key="index"
      :label="item.label"
      :name="item.value"
    ></ElTabPane>
  </ElTabs>
</template>

<script setup lang="ts">
const props = defineProps<{
  query?: Object;
  prop?: string;
  tabs?: Array<{ label: string, value: any }>;
}>()

const emit = defineEmits()

const onChange = () => {
  emit('tab-change')
}
</script>
